function close() // Closes the connection specified by XMLSocket object.
function connect(host, port) // Establishes a connection to the specified Internet host using the specified TCP port, and returns "true" or "false" depending on whether a connection is successfully established. If you don't know the port number of your Internet host machine, contact your network administrator.
function send(object) // Converts the XML object or data specified in the "object" parameter to a string and transmits it to the server, followed by a zero byte. If object is an XML object, the string is the XML textual representation of the XML object. The send operation is asynchronous; it returns immediately, but the data may be transmitted at a later time. The XMLSocket.send() method does not return a value indicating whether the data was successfully transmitted.
function onClose() // Invoked only when an open connection is closed by the server. The default implementation of this method performs no actions. To override the default implementation, you must assign a function containing your own actions.
function onConnect() // Invoked by Flash Player when a connection request initiated through XMLSocket.connect() has succeeded or failed. If the connection succeeded, the success parameter is "true"; otherwise the success parameter is "false".
function onData() // Invoked when a message has been downloaded from the server, terminated by a zero byte. You can override XMLSocket.onData to intercept the data sent by the server without parsing it as XML. This is a useful if you're transmitting arbitrarily formatted data packets, and you'd prefer to manipulate the data directly when it arrives, rather than have Flash Player parse the data as XML.
function onXML() // Invoked by Flash Player when the specified XML object containing an XML document arrives over an open XMLSocket connection. An XMLSocket connection may be used to transfer an unlimited number of XML documents between the client and the server. Each document is terminated with a 0 (zero) byte. When Flash Player receives the 0 byte, it parses all of the XML received since the previous 0 byte, or since the connection was established if this is the first message received. Each batch of parsed XML is treated as a single XML document and passed to the onXML method.